package com.gitee.service.impl;

import com.gitee.service.*;
import com.gitee.vo.CoreDataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class HomeServiceImpl implements IHomeService {

    @Autowired
    private IUserService userService;

    @Autowired
    private IOrderService orderService;

    @Autowired
    private ICommentService commentService;

    @Autowired
    private ICookbookService cookbookService;

    @Autowired
    private IFoodService foodService;

    @Override
    public CoreDataVo getCoreDataVo() {
        CoreDataVo coreDataVo = new CoreDataVo(
                cookbookService.count(),
                foodService.count(),
                orderService.count(),
                commentService.count(),
                userService.count()
        );
        return coreDataVo;
    }
}
